package cn.calm.commons.exception;

import cn.calm.commons.entity.BaseEntity;
import cn.calm.commons.entity.MessageInfo;

public class DeskException extends RuntimeException{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private MessageInfo messageInfo;

	public DeskException(MessageInfo messageInfo) {
		this.setMessageInfo(messageInfo);
	}

	public DeskException(String message, BaseEntity entity, Object... values) {
		this(new MessageInfo(message, entity, values));
	}

	public DeskException(String message) {
		this(message,null);
	}
	
	public MessageInfo getMessageInfo() {
		return messageInfo;
	}

	public void setMessageInfo(MessageInfo messageInfo) {
		this.messageInfo = messageInfo;
	}

}
